package com.symria.server.po;

import java.sql.Timestamp;
import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

import static javax.persistence.GenerationType.IDENTITY;
import javax.persistence.Id;
import javax.persistence.Table;

import org.hibernate.annotations.Formula;

/**
 * AppInfo entity. @author MyEclipse Persistence Tools
 */
@Entity
@Table(name = "APP_INFO")
public class AppInfo implements java.io.Serializable {

	// Fields

	private Integer appId;
	private String publicId;
	private Integer userId;
	private String userName;
	private String appName;
	private String appPlat;
	private String appCate;
	private Date createDate;
	private String softPath;
	private String appIco;
	private String status;
	private String appDesc;
	private String suffix;
	private String minSdk;
	private String packageName;
	private Integer rate;
	private String unit;
	// Constructors

	/** default constructor */
	public AppInfo() {
	}

	/** minimal constructor */
	public AppInfo(String publicId) {
		this.publicId = publicId;
	}

	/** full constructor */
	public AppInfo(String publicId, Integer userId, String appName,
			String appPlat, String appCate, Timestamp createDate,
			String softPath, String appIco, String status, String appDesc,
			String suffix, String minSdk, String packageName) {
		this.publicId = publicId;
		this.userId = userId;
		this.appName = appName;
		this.appPlat = appPlat;
		this.appCate = appCate;
		this.createDate = createDate;
		this.softPath = softPath;
		this.appIco = appIco;
		this.status = status;
		this.appDesc = appDesc;
		this.suffix = suffix;
		this.minSdk = minSdk;
		this.packageName = packageName;
	}

	// Property accessors
	@Id
	@GeneratedValue(strategy = IDENTITY)
	@Column(name = "APP_ID", unique = true, nullable = false)
	public Integer getAppId() {
		return this.appId;
	}

	public void setAppId(Integer appId) {
		this.appId = appId;
	}

	@Column(name = "PUBLIC_ID", nullable = false, length = 64)
	public String getPublicId() {
		return this.publicId;
	}

	public void setPublicId(String publicId) {
		this.publicId = publicId;
	}

	@Column(name = "USER_ID")
	public Integer getUserId() {
		return this.userId;
	}

	public void setUserId(Integer userId) {
		this.userId = userId;
	}
	
	
	
    @Formula("(SELECT ui.USER_NAME FROM USER_INFO ui WHERE ui.USER_ID=USER_ID)")
	public String getUserName() {
		return userName;
	}

	public void setUserName(String userName) {
		this.userName = userName;
	}

	@Column(name = "APP_NAME", length = 128)
	public String getAppName() {
		return this.appName;
	}

	public void setAppName(String appName) {
		this.appName = appName;
	}

	@Column(name = "APP_PLAT", length = 11)
	public String getAppPlat() {
		return this.appPlat;
	}

	public void setAppPlat(String appPlat) {
		this.appPlat = appPlat;
	}

	@Column(name = "APP_CATE", length = 11)
	public String getAppCate() {
		return this.appCate;
	}

	public void setAppCate(String appCate) {
		this.appCate = appCate;
	}
	@Temporal(TemporalType.TIMESTAMP)
	@Column(name = "CREATE_DATE", length = 0)
	public Date getCreateDate() {
		return this.createDate;
	}

	public void setCreateDate(Date createDate) {
		this.createDate = createDate;
	}

	@Column(name = "SOFT_PATH", length = 256)
	public String getSoftPath() {
		return this.softPath;
	}

	public void setSoftPath(String softPath) {
		this.softPath = softPath;
	}

	@Column(name = "APP_ICO", length = 256)
	public String getAppIco() {
		return this.appIco;
	}

	public void setAppIco(String appIco) {
		this.appIco = appIco;
	}

	@Column(name = "STATUS", length = 1)
	public String getStatus() {
		return this.status;
	}

	public void setStatus(String status) {
		this.status = status;
	}

	@Column(name = "APP_DESC", length = 4096)
	public String getAppDesc() {
		return this.appDesc;
	}

	public void setAppDesc(String appDesc) {
		this.appDesc = appDesc;
	}

	@Column(name = "SUFFIX", length = 10)
	public String getSuffix() {
		return this.suffix;
	}

	public void setSuffix(String suffix) {
		this.suffix = suffix;
	}

	@Column(name = "MIN_SDK", length = 8)
	public String getMinSdk() {
		return this.minSdk;
	}

	public void setMinSdk(String minSdk) {
		this.minSdk = minSdk;
	}

	@Column(name = "PACKAGE_NAME", length = 128)
	public String getPackageName() {
		return this.packageName;
	}

	public void setPackageName(String packageName) {
		this.packageName = packageName;
	}
	@Column(name = "RATE", length = 11)
	public Integer getRate() {
		return rate;
	}

	public void setRate(Integer rate) {
		this.rate = rate;
	}
	@Column(name = "UNIT", length = 20)
	public String getUnit() {
		return unit;
	}

	public void setUnit(String unit) {
		this.unit = unit;
	}
	
	
}